package day230902;

import java.util.Scanner;

/**
 * @author 兴趣使然黄小黄
 * @version 1.0
 * @date 2023/9/2 19:01
 * 小美的升序数组 100%
 */
public class Main01 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            // 录入数据
            int n = in.nextInt();
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }
            // 根据数组 arr 构造数组 b
            int[] b = new int[n];
            for (int i = 1; i < n; i++) {
                b[i - 1] = arr[i] - arr[i - 1];
            }
            boolean flagA = true; // 判断 A 是否严格升序
            boolean flagB = true; // 判断 B 是否严格降序
            int slow = 0;
            int fast = 1;
            while (fast < n) {
                if (arr[slow] >= arr[fast]) {
                    flagA = false;
                }
                if (b[slow] <= b[fast]) {
                    flagB = false;
                }
                fast++;
                slow++;
            }
            // 返回结果
            if (flagA && flagB) {
                System.out.println("Yes");
            } else {
                System.out.println("No");
            }
        }
        in.close();
    }
}
